package v1

import (
	"github.com/gin-gonic/gin"
	"jwgin/middleware"
)

type BaseRouter struct{}

func (s *BaseRouter) InitBaseRouter(Router *gin.RouterGroup) (R gin.IRoutes) {
	baseRouter := Router.Group("v1")

	//不需要登录,但是要验证域名
	baseRouter.Use(middleware.Domain())
	new(login).Routers(baseRouter)
	new(activity).Routers(baseRouter) //所有活动
	new(gift).Routers(baseRouter)     //礼品

	//公司 内容
	new(news).Routers(baseRouter)       //文章
	new(news_class).Routers(baseRouter) //文章分类
	new(resources).Routers(baseRouter)  //资源
	new(link).Routers(baseRouter)       //友情

	//登录后
	baseRouter.Use(middleware.Jwt())
	new(users).Routers(baseRouter)        //用户信息
	new(recordBean).Routers(baseRouter)   //流水
	new(exchange).Routers(baseRouter)     //兑换
	new(activitySign).Routers(baseRouter) //签到活动
	return baseRouter
}
